<include file="Public/header" />
<title>我的桌面</title>
</head>
<body>
<div class="page-container">
    <div class="text-c"> 日期范围：
        <input type="text" name="name" id="name" value="<{$Think.get.name}>" placeholder=" 名称" style="width:250px" class="input-text">
        <button id="search" class="btn btn-success" type="submit"><i class="Hui-iconfont"></i> 搜索</button>
    </div>
    <div class="mt-20">
        <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper no-footer">
            <div class="dataTables_length" id="DataTables_Table_0_length"><label>
                <span class="r" style="">共有数据：<strong><{$count}></strong> 条</span>
            </div>
            <table class="table table-border table-bordered table-bg table-hover table-sort dataTable no-footer" id="DataTables_Table_0" role="grid" aria-describedby="DataTables_Table_0_info">
                <thead>
                <tr class="text-c" role="row">
                    <th width="25" rowspan="1" colspan="1" aria-label="" style="width: 25px;"><input type="checkbox" name=""></th>
                    <th style="width: 387px;">名称</th>
                    <th width="80" style="width: 180px;">料号</th>
					<th width="80" style="width: 180px;">账册编码</th>
                    <!-- <th width="80" style="width: 80px;">HSCODE</th> -->
                    <th width="75">申报单位</th>
                    <th width="60">第一单位</th>
                    <th width="60">第二单位</th>
                    <th width="60">币制</th>
                </tr>
                </thead>
                <tbody>
                <foreach name="list" item="data">
                    <tr class="text-c odd" role="row">
                        <td><input type="checkbox" value="<{$data.id}>" name=""></td>
                        <td class="text-l"><span style="cursor:pointer" class="text-primary"><{$data.goods_name}></span></td>
                        <td><{$data.source_no}></td>
						<td><{$data.manua_id}></td>
                        <!-- <td><{$data.hs_code}></td> -->
                        <td><{$data.declare_unit}></td>
                        <td class="td-status"><{$data.unit1}></td>
                        <td class="td-status"><{$data.unit2}></td>
                        <td class="td-status"><{$data.current_type}></td>
                    </tr>
                </foreach>
                </tbody>
            </table>
            <div class="page">
                <{$page}>
            </div>
            <div style="margin-top: 32px;">
                <a href="javascript:;" onclick="product_add()" class="btn btn-primary radius"><i class="Hui-iconfont"></i>确定</a>
                <a href="javascript:;" onclick="cancel()" class="btn radius"><i class="Hui-iconfont"></i>取消</a>
            </div>
        </div>
    </div>
    </div>
    <include file="Public/footer_js" />
    <script>
        function product_add(){
            if($('input:checked').length==0){
                layer.msg('至少选择一个产品');
                return false;
            }
            var group_id='';
            for(var i=0;i<$("tbody input:checked").length;i++){
                group_id+=','+$("tbody input:checked").eq(i).prop("value");
            }
            $.get('__MODULE__/InboundPlan/product_addD',{
                id:group_id.substring(1),
            },function (msg){
                layer.msg(msg.data);
                if(msg.flag==1){
                    setTimeout(function (){
                        layer.closeAll();
                        parent.location.reload();
                    },800);
                }
            },'json');
        }
        function cancel(){
            parent.layer.closeAll();
        }
        $("select[name=page_count]").on('change',function (){
            search();
        });
        $("#search").on('click',function (){
            search();
        });
        function search(){
            var page_count=$("select[name=page_count]").val();
            var start_time=$("input[name=start_time]").val();
            var end_time=$("input[name=end_time]").val();
            var name=$("input[name=name]").val();
            var category=$("select[name=category]").val();
            location.href="__ACTION__?name="+name+"&category="+category+"&page_count="+page_count+"&start_time="+start_time+"&end_time="+end_time;
        }
        if($("select[name=page_count]").attr('tabindex')==''){
            var  page=15;
        }else{
            var  page=$("select[name=page_count]").attr('tabindex');
        }
        $("select[name=page_count]").prop('value',page);
    </script>
</body>
</html>